			
			
			* APPENDIX 7: Change in Polarization Metrics: Masses did not become more polarized
			
			
	cd "$data"
	use "data1.dta", clear 	
		
		
	keep if leftRightW6!=. & leftRightW7!=.

	* calculating bimodality coefficient 

	summarize leftRightW6, detail // skewness: -0.0485, kurtosis: 2.147
	summarize leftRightW7, detail // skewness: -0.0099, kurtosis: 2.271
	*sample size: 16774 

	scalar BC6 = (-0.0485^2 + 1) / (2.147 + (3 * (16774-1)^2 / ((16774-2) * (16774-3))))
	scalar BC7 = (-0.0099^2 + 1) / (2.271 + (3 * (16774-1)^2 / ((16774-2) * (16774-3))))

	display BC6 
	display BC7


	* calculating the spread

	summarize leftRightW6 leftRightW7 // from 2.52 to 2.41
	summarize leftRightW6 leftRightW7 if partyid6==1 | partyid6==2 // from 2.65 to 2.50


	* VISUAL OVERLAP


	twoway (kdensity leftRightW6 if partyid6==1, bwidth(0.5) lcolor(cranberry) lpattern(solid) lwidth(thin)) (kdensity leftRightW6 if partyid6==2, bwidth(0.5) lcolor(navy) lpattern(solid) lwidth(thin)) (kdensity leftRightW7 if partyid6==1, bwidth(0.5) lcolor(cranberry) lpattern(dash) lwidth(thin)) (kdensity leftRightW7 if partyid6==2, bwidth(0.5) lcolor(navy) lpattern(dash) lwidth(thin)), legend(position(6) cols(2)) xtitle("self-placement") ytitle(density) 
	graph save "${figures}Figure7_1.gph"
